import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String name = "";
        String password = "";
        int chances = 3;
        for (int i = 1; i <= 3; i++) {
            System.out.println("请输入用户名：");
            name = scanner.nextLine();
            System.out.println("请输入密码：");
            password = scanner.nextLine();
            if("丁真".equals(name) && "666".equals(password)){
                System.out.println("登录成功");
                break;
            }
            chances--;
            System.out.println("用户名或密码错误，你还有" + chances + "次机会");
        }
    }
}